#ifndef MPEG_COMPRESS_H
#define MPEG_COMPRESS_H

#include <gst/gst.h>
#include <gst/app/app.h>
#include <functional>
#include <thread>

class MPEGCompress
{
  public:
    MPEGCompress();
    virtual ~MPEGCompress();
    void InputImage(const char* data,unsigned long size);
    std::function<void(const char*,unsigned long)> funcReasultCallback;
  private:
    GstElement* appsrc,*videoconvert,*jpegenc,*jpegparse,*appsink;
    GstElement* pipeline;
    std::thread mainThread;
    std::thread workThread;
    GMainLoop* loop;
};

#endif
